package edu.spec.sms.dao.impl;

import edu.spec.sms.dao.iface.ISubjectDao;
import edu.spec.sms.model.questionnaire.Subject;
import org.madgecko.basic.dao.BaseDao;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Author       : MadFrog
 * Date         : 2018/7/6 14:15
 * Description  :
 */
@Repository
public class SubjectDao extends BaseDao<Subject> implements ISubjectDao {

    @Override
    public List<Subject> listSubjectByQuestionnaire(Integer questionnaireId) {
        String hql = "from Subject s where s.questionnaire.id=" + questionnaireId;
        return this.list(hql);
    }
}
